﻿using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Reflection;

namespace TruyenTranhCrawler.Data
{
    public class CmsDataContext : DataContext
    {
        //private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        static readonly string ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["connection"];
        public CmsDataContext()
            : base(ConnectionString)
        {
            CommandTimeout = 3600;
        }
        public Table<Book> Books
        {
            get { return GetTable<Book>(); }
        }
        public Table<Content> Contents
        {
            get { return GetTable<Content>(); }
        }

        public Table<HistoryType> HistoryTypes
        {
            get { return GetTable<HistoryType>(); }
        }

        public Table<Author> Authors
        {
            get { return GetTable<Author>(); }
        }
        public Table<BookByAuthor> BookByAuthors
        {
            get { return GetTable<BookByAuthor>(); }
        }
        public Table<BookType> BookTypes
        {
            get { return GetTable<BookType>(); }
        }
    }
}
